<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>

<html>
	<head>
		<title>山西海宁皮革城</title>
		<%@ include file="/commons/meta.jsp"%>
		<script type="text/javascript">
		$(document).ready(function(){
			
			/* setup navigation, content boxes, etc... */
			Administry.setup();
			
			/* datatable */
			$('#example').dataTable();
			
			/* expandable rows */
			Administry.expandableRows();
		});

		</script>
	</head>

	<body>
		<%@ include file="/commons/top.jsp"%>
		<!-- Page title -->
		<div id="pagetitle">
			<div class="wrapper">
				<h1>Travel Agency Information</h1>
	            <a href="travelOpt!exportExcel.do?monthTableName=<s:property value='#request.currentMonthTableName'/>" class="btn">导出Excel表格</a>
	            <a href="${ctx }/pages/travelAgencyInfo/add.jsp" class="btn"><span class="icon icon-add">&nbsp;</span>登记信息</a>
	            <form id="findTableForm" method="post" action="travelOpt!travelList.do" >
	            <div style="float:right;width:200px;padding-top:11px;">
		            <label for="monthTableName">查看月表：</label>
		            <select id="monthTableName" class="half" name="monthTableName">
						<s:iterator value="#request.tableList" var="t">
							<option value="<s:property value='#t.monthTableName' />" 
								<s:if test="#t.monthTableName == #request.currentMonthTableName "> selected </s:if> 
							>
								<s:property value='#t.monthTableName.substring(14)' />
							</option>
						</s:iterator>
					</select>
				</div>
				</form>

			</div>
		</div>
		<!-- End of Page title -->
		
		<!-- Page content -->
		<div id="page">
			<!-- Wrapper -->
			<div class="wrapper">
					<!-- Left column/section -->
					<section class="column full first">					
						
						<table class="display stylized" id="example">
							<thead>
								<tr>
									<th>登记时间</th>
									<th>旅行社</th>
									<th>车牌号</th>
									<th>车型</th>
	                                <th>城市</th>
	                                <th>景点</th>
	                                <th>是否司机</th>
	                                <th>司机</th>
	                                <th>导游</th>
	                                <th>联系方式</th>
	                                <th>签约</th>
	                                <th>停留</th>
	                                <th>司导补贴</th>
									<th>人数</th>
	                                <th>人头补贴</th>
	                                <th>合计</th>
	                                <th>付款方式</th>
	                                <th>手续</th>
	                                <th>操作</th>
								</tr>
							</thead>
							<tbody>
								<s:iterator value="#request.travelList" var="u" status="ul">
									<tr 
										<s:if test="#ul.index%4 == 0"> class="gradeX" </s:if>
										<s:if test="#ul.index%4 == 1"> class="gradeA" </s:if>
										<s:if test="#ul.index%4 == 2"> class="gradeC" </s:if>
										<s:if test="#ul.index%4 == 3"> class="gradeU" </s:if>
									>
										<td width="70" style=""><s:date name="#u.registerDate" format="yyyy-MM-dd HH:mm:ss" /></td>
										<td width="135" style="word-break:break-all;"><s:property value="#u.travelAgencyName"/></td>
										<td width="60"><s:property value="#u.carNumber"/></td>
										<td width="40" style="word-break:break-all;">
											<s:if test="#u.carType == 0">
														中巴
											</s:if>	
											<s:if test="#u.carType == 1">
														大巴
											</s:if>
										</td>
										<td width="70" style="word-break:break-all;"><s:property value="#u.city"/></td>
										<td width="70" style="word-break:break-all;"><s:property value="#u.viewpoint"/></td>
										<td width="80" style="word-break:break-all;">
											<s:if test="#u.isDriver == 1">
														是
											</s:if>	
											<s:if test="#u.isDriver == 0">
														否
											</s:if>
										</td>
										<td width="70" style="word-break:break-all;"><s:property value="#u.driver"/></td>
										<td width="70" style="word-break:break-all;"><s:property value="#u.guide"/></td>
										<td width="125" style="word-break:break-all;"><s:property value="#u.isDedicated"/></td>
										<td width="40" style="word-break:break-all;">
											<s:if test="#u.isContract == 1">
														已签
											</s:if>	
											<s:if test="#u.isContract == 0">
														未签
											</s:if>
										</td>
										<td width="60" style="word-break:break-all;"><s:property value="#u.remainTime"/></td>
										
										<td width="80" style="word-break:break-all;"><s:property value="#u.subsidyPrice"/></td>
										<td width="50" style="word-break:break-all;"><s:property value="#u.countPeople"/></td>
										<td width="80" style="word-break:break-all;"><s:property value="#u.travelerPrice"/></td>
										<td width="50" style="word-break:break-all;"><s:property value="#u.totalPrice"/></td>
		                                <td width="80" style="word-break:break-all;">
											<s:if test="#u.payType == 0">
														留存
											</s:if>
		                                	<s:if test="#u.payType == 1">
														现结
											</s:if>	
										</td>
										<td width="40" style="word-break:break-all;">
											<s:if test="#u.handle == 0">
												<s:if test="#session.login_user.permission == 1 || #session.login_user.permission == 2">
														<a href="#confirm"
															onclick="setUrl('travelOpt!modifyHandle.do?agencyId=<s:property value="#u.agencyId"/>&monthTableName=<s:property value="#request.currentMonthTableName" />','处理<s:property value="#u.travelAgencyName"/>信息');" 
					                                		class="nyroModal">未办</a>
					                            </s:if>
					                            <s:if test="#session.login_user.permission == 3 ">
					                            	未办
					                            </s:if>
											</s:if>
		                                	<s:if test="#u.handle == 1">
														<span style="color:red;">已办</span>
											</s:if>	
										</td>
		                                <td width="96" style="word-break:break-all;">
		                                	<s:if test="#u.handle == 0">
			                                	<a href="travelOpt!goModifyTravelPage.do?agencyId=<s:property value='#u.agencyId'/>&monthTableName=<s:property value='#request.currentMonthTableName'/>">修改</a>
				                                |
				                                <a href="#confirm"  
					                                onclick="setUrl('travelOpt!removeTravel.do?agencyId=<s:property value="#u.agencyId"/>&monthTableName=<s:property value="#request.currentMonthTableName" />','删除<s:property value="#u.travelAgencyName"/>信息');" 
					                                class="nyroModal">删除</a>
			                                </s:if>
			                            </td>
									</tr>
								</s:iterator>
							</tbody>
							<tfoot>
								<tr>
									<th>登记时间</th>
									<th>旅行社</th>
									<th>车牌号</th>
									<th>车型</th>
	                                <th>城市</th>
	                                <th>景点</th>
	                                <th>是否司机</th>
	                                <th>司机</th>
	                                <th>导游</th>
	                                <th>联系方式</th>
	                                <th>签约</th>
	                                <th>停留</th>
	                                <th>司导补贴</th>
									<th>人数</th>
	                                <th>人头补贴</th>
	                                <th>合计</th>
	                                <th>付款方式</th>
	                                <th>手续</th>
	                                <th>操作</th>
								</tr>
							</tfoot>
						</table>
						
						<div class="clear">&nbsp;</div>
						
					</section>
					<!-- End of Left column/section -->
					
					
			</div>
			<!-- End of Wrapper -->
		</div>
		<!-- End of Page content -->
		
		<!-- Page footer -->
		<%@ include file="/commons/footer.jsp"%>
		<!-- End of Page footer -->
		
		
		<!-- Scroll to top link -->
		<a href="#" id="totop">^ scroll to top</a>
	
		<!-- User interface javascript load -->
		<script type="text/javascript" SRC="js/administry.js"></script>
		<script type="text/javascript">
		$('#monthTableName').bind('change',function(){
			document.forms[2].submit();
		});
		</script>
	</body>
</html>
